package com.goddess.yeecolor.webview;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;

import com.goddess.yeecolor.R;
import com.goddess.yeecolor.base.BaseActivity;

import butterknife.ButterKnife;
import butterknife.InjectView;
import butterknife.OnClick;

/**
 * 作者: CaoJunping
 * 时间: 2017/2/7
 * 作用: ******
 * 备注: ******
 */
public class WatchAcitvityWebView extends BaseActivity {

    @InjectView(R.id.img_back)
    ImageView imgBack;
    @InjectView(R.id.watch_webview)
    WebView watchWebview;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        setTheme(R.style.AppTheme);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_watchwebview);
        ButterKnife.inject(this);
        initData();
    }

    @Override
    public void initOnClck() {

    }

    @Override
    public void initFindView() {

    }

    @Override
    public void initData() {
        Intent intent=getIntent();
        String webView=intent.getStringExtra("webview");
        watchWebview.loadUrl(webView);
        watchWebview.setWebViewClient(new WebViewClient(){
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                view.loadUrl(url);
                return true;
            }
        });
    }

    @OnClick(R.id.img_back)
    public void onClick() {
        finish();
    }
}
